function Readin_moments(dir::String)


    #gargetred moments
    temp = CSV.read("$dir\\moments\\moments.csv", DataFrame; skipto=1)
    moments = Matrix(temp)

    #state migration matrix
    temp = CSV.read("$dir\\moments\\migration_matrix.csv", DataFrame; skipto=1)
    mig_mat = Matrix(temp)

    #college attendnace for kids with college-educated parnts
    temp = CSV.read("$dir\\moments\\attendance_coll.csv", DataFrame; skipto=1)
    attendance_coll = Matrix(temp)

    #teh same, but non-college educated parents
    temp = CSV.read("$dir\\moments\\attendance_noncoll.csv", DataFrame; skipto=1)
    attendance_hs = Matrix(temp)

    #infloow moments
    temp = CSV.read("$dir\\moments\\state_inflow_rates.csv", DataFrame; skipto=1)
    state_inflow = Matrix(temp)

    #state-level iim rates
    temp = CSV.read("$dir\\moments\\state_iim.csv", DataFrame; skipto=1)
    state_iim = Matrix(temp)

    #state-level iim rates
    temp = CSV.read("$dir\\moments\\moments_race.csv", DataFrame; skipto=1)
    moments_race = Matrix(temp)

    #collect and return
    package_moments = [moments, mig_mat, attendance_coll, attendance_hs, state_inflow, state_iim, moments_race]
    package_moments
end


#####read in model utilities
function Readin_utilities(dir::String)
    #state characteristics, 2000
    temp = CSV.read("$dir\\utilities\\state_chars_2000.csv", DataFrame; skipto=1)
    state_chars_2000 = Matrix(temp)

    #state characteristics, 2010
    temp = CSV.read("$dir\\utilities\\state_chars_2010.csv", DataFrame; skipto=1)
    state_chars_2010 = Matrix(temp)

    #distance matrix
    temp = CSV.read("$dir\\utilities\\state_prox_mat.csv", DataFrame; skipto=1)
    prox_mat = Matrix(temp)

    #parent initial distribution
    temp = CSV.read("$dir\\utilities\\state_parent_distributions.csv", DataFrame; skipto=1)
    parent_dist = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\state_parent_distributions_p25.csv", DataFrame; skipto=1)
    parent_dist_p25 = Matrix(temp)

    #parent p25 marriage probs. We'll think about how to make the P25 distribution later.
    #temp = CSV.read("$dir\\utilities\\parent_marriage_probs_p25.csv", DataFrame; skipto=1)
    #parent_marr_p25 = Matrix(temp)

    #kid marriage probabiltiies -- no college
    temp = CSV.read("$dir\\utilities\\kid_marriage_probs_noncoll.csv", DataFrame; skipto=1)
    kid_marr_hs = Matrix(temp)

    #kid fertility probabiltiies -- married, no college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_marr_noncoll.csv", DataFrame; skipto=1)
    kid_fert_marr_hs = Matrix(temp)

    #kid fertility probabiltiies -- not married, no college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_nonmarr_noncoll.csv", DataFrame; skipto=1)
    kid_fert_nonmarr_hs = Matrix(temp)

    #kid marriage probabiltiies -- college
    temp = CSV.read("$dir\\utilities\\kid_marriage_probs_coll.csv", DataFrame; skipto=1)
    kid_marr_coll = Matrix(temp)

    #kid fertility probabiltiies -- married, college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_marr_coll.csv", DataFrame; skipto=1)
    kid_fert_marr_coll = Matrix(temp)

    #kid fertility probabiltiies -- not married, college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_nonmarr_coll.csv", DataFrame; skipto=1)
    kid_fert_nonmarr_coll = Matrix(temp)

    #financial aid
    temp = CSV.read("$dir\\utilities\\student_aid.csv", DataFrame; skipto=1)
    aid_sched = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\state_child_marr_distributions.csv", DataFrame; skipto=1)
    kid_marr_dist = Matrix(temp)

    temp = CSV.read("$dir\\boot\\weight_matrix.csv", DataFrame; skipto=1)
    W = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\amenities_2000.csv", DataFrame; skipto=1)
    amen_2000 = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\amenities_2010.csv", DataFrame; skipto=1)
    amen_2010 = Matrix(temp)

    package = [state_chars_2000, state_chars_2010, prox_mat, parent_dist, kid_marr_hs, kid_fert_marr_hs, kid_fert_nonmarr_hs, kid_marr_coll, kid_fert_marr_coll, kid_fert_nonmarr_coll, parent_dist_p25, aid_sched, kid_marr_dist, W, amen_2000, amen_2010]
    package #return all the matrices
end




#####read in model utilities
function Readin_utilities_cfact_1(dir::String)
    #state characteristics, 2000
    temp = CSV.read("$dir\\utilities\\state_chars_2000_cfact_1.csv", DataFrame; skipto=1)
    state_chars_2000 = Matrix(temp)

    #state characteristics, 2010
    temp = CSV.read("$dir\\utilities\\state_chars_2010_cfact_1.csv", DataFrame; skipto=1)
    state_chars_2010 = Matrix(temp)

    #distance matrix
    temp = CSV.read("$dir\\utilities\\state_prox_mat.csv", DataFrame; skipto=1)
    prox_mat = Matrix(temp)

    #parent initial distribution
    temp = CSV.read("$dir\\utilities\\state_parent_distributions.csv", DataFrame; skipto=1)
    parent_dist = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\state_parent_distributions_p25.csv", DataFrame; skipto=1)
    parent_dist_p25 = Matrix(temp)

    #parent p25 marriage probs. We'll think about how to make the P25 distribution later.
    #temp = CSV.read("$dir\\utilities\\parent_marriage_probs_p25.csv", DataFrame; skipto=1)
    #parent_marr_p25 = Matrix(temp)

    #kid marriage probabiltiies -- no college
    temp = CSV.read("$dir\\utilities\\kid_marriage_probs_noncoll.csv", DataFrame; skipto=1)
    kid_marr_hs = Matrix(temp)

    #kid fertility probabiltiies -- married, no college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_marr_noncoll.csv", DataFrame; skipto=1)
    kid_fert_marr_hs = Matrix(temp)

    #kid fertility probabiltiies -- not married, no college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_nonmarr_noncoll.csv", DataFrame; skipto=1)
    kid_fert_nonmarr_hs = Matrix(temp)

    #kid marriage probabiltiies -- college
    temp = CSV.read("$dir\\utilities\\kid_marriage_probs_coll.csv", DataFrame; skipto=1)
    kid_marr_coll = Matrix(temp)

    #kid fertility probabiltiies -- married, college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_marr_coll.csv", DataFrame; skipto=1)
    kid_fert_marr_coll = Matrix(temp)

    #kid fertility probabiltiies -- not married, college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_nonmarr_coll.csv", DataFrame; skipto=1)
    kid_fert_nonmarr_coll = Matrix(temp)

    #financial aid
    temp = CSV.read("$dir\\utilities\\student_aid.csv", DataFrame; skipto=1)
    aid_sched = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\state_child_marr_distributions.csv", DataFrame; skipto=1)
    kid_marr_dist = Matrix(temp)

    temp = CSV.read("$dir\\boot\\weight_matrix.csv", DataFrame; skipto=1)
    W = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\amenities_2000.csv", DataFrame; skipto=1)
    amen_2000 = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\amenities_2010.csv", DataFrame; skipto=1)
    amen_2010 = Matrix(temp)

    package = [state_chars_2000, state_chars_2010, prox_mat, parent_dist, kid_marr_hs, kid_fert_marr_hs, kid_fert_nonmarr_hs, kid_marr_coll, kid_fert_marr_coll, kid_fert_nonmarr_coll, parent_dist_p25, aid_sched, kid_marr_dist, W, amen_2000, amen_2010]
    package #return all the matrices
end




#####read in model utilities
function Readin_utilities_cfact_2(dir::String)
    #state characteristics, 2000
    temp = CSV.read("$dir\\utilities\\state_chars_2000_cfact_2.csv", DataFrame; skipto=1)
    state_chars_2000 = Matrix(temp)

    #state characteristics, 2010
    temp = CSV.read("$dir\\utilities\\state_chars_2010_cfact_2.csv", DataFrame; skipto=1)
    state_chars_2010 = Matrix(temp)

    #distance matrix
    temp = CSV.read("$dir\\utilities\\state_prox_mat.csv", DataFrame; skipto=1)
    prox_mat = Matrix(temp)

    #parent initial distribution
    temp = CSV.read("$dir\\utilities\\state_parent_distributions.csv", DataFrame; skipto=1)
    parent_dist = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\state_parent_distributions_p25.csv", DataFrame; skipto=1)
    parent_dist_p25 = Matrix(temp)

    #parent p25 marriage probs. We'll think about how to make the P25 distribution later.
    #temp = CSV.read("$dir\\utilities\\parent_marriage_probs_p25.csv", DataFrame; skipto=1)
    #parent_marr_p25 = Matrix(temp)

    #kid marriage probabiltiies -- no college
    temp = CSV.read("$dir\\utilities\\kid_marriage_probs_noncoll.csv", DataFrame; skipto=1)
    kid_marr_hs = Matrix(temp)

    #kid fertility probabiltiies -- married, no college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_marr_noncoll.csv", DataFrame; skipto=1)
    kid_fert_marr_hs = Matrix(temp)

    #kid fertility probabiltiies -- not married, no college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_nonmarr_noncoll.csv", DataFrame; skipto=1)
    kid_fert_nonmarr_hs = Matrix(temp)

    #kid marriage probabiltiies -- college
    temp = CSV.read("$dir\\utilities\\kid_marriage_probs_coll.csv", DataFrame; skipto=1)
    kid_marr_coll = Matrix(temp)

    #kid fertility probabiltiies -- married, college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_marr_coll.csv", DataFrame; skipto=1)
    kid_fert_marr_coll = Matrix(temp)

    #kid fertility probabiltiies -- not married, college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_nonmarr_coll.csv", DataFrame; skipto=1)
    kid_fert_nonmarr_coll = Matrix(temp)

    #financial aid
    temp = CSV.read("$dir\\utilities\\student_aid.csv", DataFrame; skipto=1)
    aid_sched = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\state_child_marr_distributions.csv", DataFrame; skipto=1)
    kid_marr_dist = Matrix(temp)

    temp = CSV.read("$dir\\boot\\weight_matrix.csv", DataFrame; skipto=1)
    W = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\amenities_2000.csv", DataFrame; skipto=1)
    amen_2000 = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\amenities_2010.csv", DataFrame; skipto=1)
    amen_2010 = Matrix(temp)

    package = [state_chars_2000, state_chars_2010, prox_mat, parent_dist, kid_marr_hs, kid_fert_marr_hs, kid_fert_nonmarr_hs, kid_marr_coll, kid_fert_marr_coll, kid_fert_nonmarr_coll, parent_dist_p25, aid_sched, kid_marr_dist, W, amen_2000, amen_2010]
    package #return all the matrices
end


#####read in model utilities
function Readin_utilities_cfact_3(dir::String)
    #state characteristics, 2000
    temp = CSV.read("$dir\\utilities\\state_chars_2000_cfact_3.csv", DataFrame; skipto=1)
    state_chars_2000 = Matrix(temp)

    #state characteristics, 2010
    temp = CSV.read("$dir\\utilities\\state_chars_2010_cfact_3.csv", DataFrame; skipto=1)
    state_chars_2010 = Matrix(temp)

    #distance matrix
    temp = CSV.read("$dir\\utilities\\state_prox_mat.csv", DataFrame; skipto=1)
    prox_mat = Matrix(temp)

    #parent initial distribution
    temp = CSV.read("$dir\\utilities\\state_parent_distributions.csv", DataFrame; skipto=1)
    parent_dist = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\state_parent_distributions_p25.csv", DataFrame; skipto=1)
    parent_dist_p25 = Matrix(temp)

    #parent p25 marriage probs. We'll think about how to make the P25 distribution later.
    #temp = CSV.read("$dir\\utilities\\parent_marriage_probs_p25.csv", DataFrame; skipto=1)
    #parent_marr_p25 = Matrix(temp)

    #kid marriage probabiltiies -- no college
    temp = CSV.read("$dir\\utilities\\kid_marriage_probs_noncoll.csv", DataFrame; skipto=1)
    kid_marr_hs = Matrix(temp)

    #kid fertility probabiltiies -- married, no college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_marr_noncoll.csv", DataFrame; skipto=1)
    kid_fert_marr_hs = Matrix(temp)

    #kid fertility probabiltiies -- not married, no college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_nonmarr_noncoll.csv", DataFrame; skipto=1)
    kid_fert_nonmarr_hs = Matrix(temp)

    #kid marriage probabiltiies -- college
    temp = CSV.read("$dir\\utilities\\kid_marriage_probs_coll.csv", DataFrame; skipto=1)
    kid_marr_coll = Matrix(temp)

    #kid fertility probabiltiies -- married, college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_marr_coll.csv", DataFrame; skipto=1)
    kid_fert_marr_coll = Matrix(temp)

    #kid fertility probabiltiies -- not married, college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_nonmarr_coll.csv", DataFrame; skipto=1)
    kid_fert_nonmarr_coll = Matrix(temp)

    #financial aid
    temp = CSV.read("$dir\\utilities\\student_aid.csv", DataFrame; skipto=1)
    aid_sched = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\state_child_marr_distributions.csv", DataFrame; skipto=1)
    kid_marr_dist = Matrix(temp)

    temp = CSV.read("$dir\\boot\\weight_matrix.csv", DataFrame; skipto=1)
    W = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\amenities_2000.csv", DataFrame; skipto=1)
    amen_2000 = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\amenities_2010.csv", DataFrame; skipto=1)
    amen_2010 = Matrix(temp)

    package = [state_chars_2000, state_chars_2010, prox_mat, parent_dist, kid_marr_hs, kid_fert_marr_hs, kid_fert_nonmarr_hs, kid_marr_coll, kid_fert_marr_coll, kid_fert_nonmarr_coll, parent_dist_p25, aid_sched, kid_marr_dist, W, amen_2000, amen_2010]
    package #return all the matrices
end

#####read in model utilities
function Readin_utilities_cfact_4(dir::String)
    #state characteristics, 2000
    temp = CSV.read("$dir\\utilities\\state_chars_2000_cfact_4.csv", DataFrame; skipto=1)
    state_chars_2000 = Matrix(temp)

    #state characteristics, 2010
    temp = CSV.read("$dir\\utilities\\state_chars_2010_cfact_4.csv", DataFrame; skipto=1)
    state_chars_2010 = Matrix(temp)

    #distance matrix
    temp = CSV.read("$dir\\utilities\\state_prox_mat.csv", DataFrame; skipto=1)
    prox_mat = Matrix(temp)

    #parent initial distribution
    temp = CSV.read("$dir\\utilities\\state_parent_distributions.csv", DataFrame; skipto=1)
    parent_dist = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\state_parent_distributions_p25.csv", DataFrame; skipto=1)
    parent_dist_p25 = Matrix(temp)

    #parent p25 marriage probs. We'll think about how to make the P25 distribution later.
    #temp = CSV.read("$dir\\utilities\\parent_marriage_probs_p25.csv", DataFrame; skipto=1)
    #parent_marr_p25 = Matrix(temp)

    #kid marriage probabiltiies -- no college
    temp = CSV.read("$dir\\utilities\\kid_marriage_probs_noncoll.csv", DataFrame; skipto=1)
    kid_marr_hs = Matrix(temp)

    #kid fertility probabiltiies -- married, no college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_marr_noncoll.csv", DataFrame; skipto=1)
    kid_fert_marr_hs = Matrix(temp)

    #kid fertility probabiltiies -- not married, no college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_nonmarr_noncoll.csv", DataFrame; skipto=1)
    kid_fert_nonmarr_hs = Matrix(temp)

    #kid marriage probabiltiies -- college
    temp = CSV.read("$dir\\utilities\\kid_marriage_probs_coll.csv", DataFrame; skipto=1)
    kid_marr_coll = Matrix(temp)

    #kid fertility probabiltiies -- married, college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_marr_coll.csv", DataFrame; skipto=1)
    kid_fert_marr_coll = Matrix(temp)

    #kid fertility probabiltiies -- not married, college
    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_nonmarr_coll.csv", DataFrame; skipto=1)
    kid_fert_nonmarr_coll = Matrix(temp)

    #financial aid
    temp = CSV.read("$dir\\utilities\\student_aid.csv", DataFrame; skipto=1)
    aid_sched = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\state_child_marr_distributions.csv", DataFrame; skipto=1)
    kid_marr_dist = Matrix(temp)

    temp = CSV.read("$dir\\boot\\weight_matrix.csv", DataFrame; skipto=1)
    W = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\amenities_2000.csv", DataFrame; skipto=1)
    amen_2000 = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\amenities_2010.csv", DataFrame; skipto=1)
    amen_2010 = Matrix(temp)

    package = [state_chars_2000, state_chars_2010, prox_mat, parent_dist, kid_marr_hs, kid_fert_marr_hs, kid_fert_nonmarr_hs, kid_marr_coll, kid_fert_marr_coll, kid_fert_nonmarr_coll, parent_dist_p25, aid_sched, kid_marr_dist, W, amen_2000, amen_2010]
    package #return all the matrices
end


#function for readin gin decomposition files
function Readin_decomp(dir::String)
    #state characteristics, 2000
    temp = CSV.read("$dir\\utilities\\state_chars_2000_decomp_d.csv", DataFrame; skipto=1)
    state_chars_2000_d = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\state_chars_2000_decomp_e.csv", DataFrame; skipto=1)
    state_chars_2000_e = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\state_chars_2000_decomp_s.csv", DataFrame; skipto=1)
    state_chars_2000_s = Matrix(temp)

    #state characteristics, 2010
    temp = CSV.read("$dir\\utilities\\state_chars_2010_decomp_d.csv", DataFrame; skipto=1)
    state_chars_2010_d = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\state_chars_2010_decomp_e.csv", DataFrame; skipto=1)
    state_chars_2010_e = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\state_chars_2010_decomp_s.csv", DataFrame; skipto=1)
    state_chars_2010_s = Matrix(temp)


    #marriage/fertility decompsitions
    temp = CSV.read("$dir\\utilities\\state_parent_distributions_decomp_d.csv", DataFrame; skipto=1)
    parent_dist_d = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\kid_marriage_probs_ncoll_decomp_d.csv", DataFrame; skipto=1)
    kid_marr_hs_d = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_marr_ncoll_decomp_d.csv", DataFrame; skipto=1)
    kid_fert_marr_hs_d = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_nmarr_ncoll_decomp_d.csv", DataFrame; skipto=1)
    kid_fert_nonmarr_hs_d = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\kid_marriage_probs_coll_decomp_d.csv", DataFrame; skipto=1)
    kid_marr_coll_d = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_marr_coll_decomp_d.csv", DataFrame; skipto=1)
    kid_fert_marr_coll_d = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\kid_fertility_probs_nmarr_coll_decomp_d.csv", DataFrame; skipto=1)
    kid_fert_nonmarr_coll_d = Matrix(temp)

    temp = CSV.read("$dir\\utilities\\state_child_marr_distributions_decomp_d.csv", DataFrame; skipto=1)
    kid_marr_dist_d = Matrix(temp)

    package = [state_chars_2000_d, state_chars_2000_e, state_chars_2000_s, state_chars_2010_d, state_chars_2010_e, state_chars_2010_s, parent_dist_d, kid_marr_hs_d, kid_fert_marr_hs_d, kid_fert_nonmarr_hs_d, kid_marr_coll_d, kid_fert_marr_coll_d, kid_fert_nonmarr_coll_d, kid_marr_dist_d]
    package #return all the matrices
end
